//package com.wst.system.config.sharding.config.ds;
//
//import io.shardingsphere.api.algorithm.sharding.ListShardingValue;
//import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue;
//import io.shardingsphere.api.algorithm.sharding.ShardingValue;
//import io.shardingsphere.api.algorithm.sharding.complex.ComplexKeysShardingAlgorithm;
//import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm;
//import lombok.extern.slf4j.Slf4j;
//
//import java.util.*;
//
//@Slf4j
//public class DsDataShardConfig implements ComplexKeysShardingAlgorithm {
//
//
//    @Override
//    public Collection<String> doSharding(Collection<String> collection, Collection<ShardingValue> collection1) {
//        for (String targetName : collection) {
//            log.info("dataSorce: {}", targetName);
//        }
//        Collection id=getColumnValue(collection1,"id");
//        if(id!=null){
//            log.info("id value:{}",id);
//        }
//        Set<String> result = new HashSet<>();
//        result.add("db0");
//        return result;
//    }
//
//    private Collection getColumnValue(Collection<ShardingValue> shardingValues,String key){
//        if(shardingValues == null){
//            return null;
//        }
//        for (ShardingValue shardingValue : shardingValues) {
//            if(shardingValue instanceof ListShardingValue){
//                ListShardingValue listShardingValue=(ListShardingValue) shardingValue;
//                if(listShardingValue.getColumnName().equals(key)){
//                    return listShardingValue.getValues();
//                }
//            }
//        }
//        return null;
//    }
//}
